<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ taglib uri="/tag" prefix="tag"%>
<tag:customerLogonCheck/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<link href="../style/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript">

function checkForm(){

	  var original_pwd = $("#original_pwd").val();
	  var pwd = $("#pwd").val();
	  var pwd_repeat = $("#pwd_repeat").val();

	  if( original_pwd  ==  "" ){
		  $("#original_pwd").focus();
		  alert("请填写原密码。");
		  return false;
	  }

	  if( pwd  ==  ""){
		  $("#pwd").focus();
		  alert("请填写密码。");
		  return false;
	  }
	  
	  if( pwd_repeat  ==  ""){
		  $("#pwd_repeat").focus();
		  alert("请填写确认密码。");
		  return false;
	  }

	  if( pwd != pwd_repeat){
		  $("#pwd").val("");
		  $("#pwd_repeat").val("");
		  $("#pwd").focus();
		  alert("两次输入的密码不一致。");
		  return false;
	  }

	  $("#registerForm").submit();
}
</script>

<style type="text/css">
#main{margin: 0 auto;width: 960px;padding-bottom: 20px;margin-top: 5px;background: #ffffff;border: 1px solid #ccc;min-height: 400px;}
.message {font-family: 宋体;font-size: 16px;color: red;list-style: none;margin: 0;padding: 0;}
.message li {margin: 0;padding-left: 30px;}
</style>

</head>
<body>

	<%@include file="/commons/head.jsp"%>
	
	<%@include file="/user/customer_menu.jsp"%>

 <div id="main">
 
		<form action="${ctx }/customer/customerAction!changePwd.do" method="post" id="registerForm" name="registerForm">
		  <table width="960" cellspacing="10" cellpadding="0" align="center" style="font-family: 宋体;font-size: 14px;color: #666666;">
				<tr>
					<td width="35%"></td><td><s:actionmessage cssClass="message" theme="simple" /></td>
				</tr>
				<tr>
					<td></td>
					<td height="30"><b style="color: #D20404;">修改密码</b></td>
				</tr>
				<tr>
					<td align="right">原密码：</td>
					<td><input name="original_pwd" id="original_pwd" value="" type="password" /></td>
				</tr>
				<tr>
					<td align="right">新密码：</td>
					<td><input name="pwd" id="pwd" value="" type="password" /></td>
				</tr>
				<tr>
					<td align="right">确认密码：</td>
					<td><input name="pwd_repeat" id="pwd_repeat" value="" type="password" /></td>
				</tr>
				<tr>
					<td>
						<!-- 隐藏域 begin -->
							<input name="customerInfo.id" value="${ sessionScope.customerInfo.id}" type="hidden" />
						 <!-- 隐藏域 end -->
					</td>
					<td><input type="button" value="提交" onclick="checkForm()" /></td>
				</tr>
		   </table>
		</form>
</div>

	<%@ include file="/commons/foot.jsp" %>

</body>
</html>